
function addFavorite(sURL, sTitle) {
	try {
		window.external.addFavorite(sURL, sTitle);
	}
	catch (e) {
		try {
			window.sidebar.addPanel(sTitle, sURL, "");
		}
		catch (e) {
			alert("\u52a0\u5165\u6536\u85cf\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528Ctrl+D\u8fdb\u884c\u6dfb\u52a0");
		}
	}
}
function setHome(obj, vrl) {
	try {
		obj.style.behavior = "url(#default#homepage)";
		obj.setHomePage(vrl);
	}
	catch (e) {
		if (window.netscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}
			catch (e) {
				alert("\u6b64\u64cd\u4f5c\u88ab\u6d4f\u89c8\u5668\u62d2\u7edd\uff01\n\u8bf7\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165\u201cabout:config\u201d\u5e76\u56de\u8f66\n\u7136\u540e\u5c06 [signed.applets.codebase_principal_support]\u7684\u503c\u8bbe\u7f6e\u4e3a'true',\u53cc\u51fb\u5373\u53ef\u3002");
			}
			var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
			prefs.setCharPref("browser.startup.homepage", vrl);
		}
	}
}
function makeKey(action) {
	var key = document.getElementById("key");
	if (action == "on") {
		if (key.value == "\u8bf7\u8f93\u5165\u5173\u952e\u5b57\uff01") {
			key.value = "";
		}
	} else {
		if (action == "out") {
			if (key.value == "") {
				key.value = "\u8bf7\u8f93\u5165\u5173\u952e\u5b57\uff01";
			}
		} else {
			alert("\u4e0d\u652f\u6301" + aciton + "\u65b9\u6cd5\uff01");
		}
	}
	if (key.value == "\u8bf7\u8f93\u5165\u5173\u952e\u5b57\uff01") {
		key.style.color = "#bbb";
	} else {
		key.style.color = "#000";
	}
}
function showSchool() {
	var ss = $("#schools>div>span");

	var style = font_size + margin_left;
	
	for (var i = 0; i < ss.length; i++) {
		var font_size = getRandom(14, 2, 36);
	    var margin_left = getRandom(10, 10, 550) + "px";
		$(ss[i]).css("font-size",font_size);
		$(ss[i]).css("margin-left",margin_left);
	}
}
function getRandom(min, step, max) {
	var l = Math.floor((max - min)/step);
	var r = min + Math.floor(Math.random() * l ) * step;
	return r;
}

